<div data-role="content">
<h3>Benvingut <?php echo $user->getName(); ?>!</h3>
Tens <?php echo $points; ?> ecopunts

<?php 

$html = '';

if( $categories )
{
	$jj = 1;
	$html .= '<table id="itemgrid"><tr>';
	foreach( $categories as $category )
	{
		$html .= '<td style="text-align:center;"><a href="getitems.php?c='.$category->getId_category().'"><img src="images/icons/i0'.$jj.'.png" /><br />'.$category->getName().'</a></td>';
		
		if( !($jj%3) )
		  $html .= '</tr><tr>';
		$jj++;
	}
	$html .= '</table>';
}

echo $html;

?>
</div>